﻿using DE_MVC_WyFy.Areas.Administrator.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DE_MVC_WyFy.Models
{
	public class ProductModel
	{
		public static List<Product> ProductForMen(bool isMale)
		{
			List<ProductType> lsProdType = ProductType.Objects.Find(c => c.IsMale == isMale).ToList();
			List<Product> lsProd = new List<Product>();
			foreach (var item in lsProdType)
				lsProd.AddRange(Product.Objects.Find(c => c.ProductTypeID == item.ProductTypeID));
			int count = lsProd.Count;
			int index = new Random().Next(count - 5);
			return lsProd.Skip(index).Take(8).ToList(); ;
		}



	}
}